Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block with statistics by lessons quantity #2616

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

Renatavl
Copy link
Contributor

image

image

image

import QuantityLessonsChart from './QuantityLessonsChart'
import { useTranslation } from 'react-i18next'

const currencies = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relocate to .constants.tsx


const currencies = [
{
value: 'USD',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create enum for currencies

}
]

const subjects = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subjects should be taken from user mainSubjects

}
]

const years = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Date here

Comment on lines 36 to 37
backgroundColor: '#79B260',
borderColor: '#79B260',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use palette

datasets: [
{
label: 'Lessons',
data: [5, 5, 10, 10, 12, 15, 14, 14, 10, 10, 12, 12],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this data represent accepted offers?

display: false
},
ticks: {
color: '#455A64',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use palette

]
}

const options = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relocate to .constants.tsx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This object directly belongs to component properties, but not a hardcoded value which is used as input data for the component. That's why it is better to leave it at the same place as the component

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand why we can't move these constant values to constants.tsx file, because we store constants in separate files to avoid cluttering files with components

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can move these constants to another file and just import them, because now the component is heavily cluttered


const data = {
labels: [
'JAN',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its probably better to use Date here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed because in the end result we will get the same results as with Date. We simply have a fixed list of months that doesn't change in any way and doesn't depend on anything.

@Renatavl Renatavl requested a review from Mav-Ivan October 22, 2024 21:08
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the QuantityLessonsChart component located in a folder meant for another component?

]
}

const options = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand why we can't move these constant values to constants.tsx file, because we store constants in separate files to avoid cluttering files with components

@Renatavl Renatavl force-pushed the feature/459/statistics-block-with-lessons-quantity branch from e8c10fd to 28db1e0 Compare November 2, 2024 19:41
@Renatavl Renatavl requested a review from PavloDolia November 2, 2024 19:41
{
value: 'Music'
},

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the blank lines

color: 'basic.darkGray',
mb: '5px'
},

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with blank lines

@Renatavl Renatavl force-pushed the feature/459/statistics-block-with-lessons-quantity branch from 28db1e0 to dd0816e Compare November 14, 2024 00:09
@Renatavl Renatavl merged commit f30bec9 into develop Nov 14, 2024
9 checks passed
@Renatavl Renatavl deleted the feature/459/statistics-block-with-lessons-quantity branch November 14, 2024 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Frontend part Tutor Implementation that regard to the tutor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(SP: 2) [Tutor's Homepage] Implement block with statistics by lessons quantity
7 participants